<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Zuoye extends MY_Controller {
	function detail($id){
		$sql = "SELECT zy.*,sub.name as subject_name,sub.img FROM tiku_zuoye zy left join tiku_b_subject sub on sub.id = zy.subject_id where zy.id='{$id}'";
		$result = $this->db->query($sql)->row_array();
		if(!$result){
			show_error("404 data not defined");
            exit;
		}
		$result['submit_time'] = $today = date('Y-m-d H:s',$result['submit_time']);
		$this->smarty->assign("zuoye_info", $result);
		$this->smarty->display("h5/zuoye_detail.html");
	}
}